package com.cx.base.day10_wrapperClass;

import java.util.Comparator;

/**
 * @Author: robert.song
 * @Date: Created in 2022/5/9
 */
public class Util_01_Integer {

    public static void main(String[] args) {
        System.out.println("string".startsWith("s"));
        System.out.println("string".replace("s", "aa"));
//        转换成Integer
//        将字符串解析为Integer对象
        System.out.println(Integer.decode("15"));
//        将int转为Integer对象
        System.out.println(Integer.valueOf(15));
//        将字符串按照指定的进制转换成Integer
        System.out.println(Integer.valueOf("ff", 16));
//        转换成int
//        1、将字符串按照指定进制转换成int
        System.out.println(Integer.parseInt("145"));
        System.out.println(Integer.parseInt("ff", 16));
//        2、基于Integer获取对应的int
        int i = new Integer(14);
        System.out.println(i);
        System.out.println(new Integer(14).intValue());
//        转换成字符串
//        1、将int按照指定进制转成字符串
        System.out.println(Integer.toString(15, 16));
//        2、将int按照进制字符串方法转换成字符串
        System.out.println(Integer.toHexString(15));
        System.out.println(Integer.toOctalString(15));
        System.out.println(Integer.toBinaryString(15));
        System.out.println(Integer.toString(15));   // toString默认是十进制
//        获取极值
        System.out.println(Integer.max(1, 2));
        System.out.println(Integer.sum(1, 2));
        System.out.println(Integer.min(1, 2));
        System.out.println(Integer.compare(1, 2));
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);
        System.out.println(Long.MAX_VALUE);
    }
}